home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AEMail 2.40
/
AEMail v2.40.iso
/
arexx
/
deladrgrp.aem
< prev
next >
Wrap
Text File
|
2000-03-11
|
1KB
|
56 lines
/* AEMail Delete Name Variable from Address Book Group */
OPTIONS RESULTS
/* TRACE ALL */
GETVAR
emailaddr = RESULT
IF (POS('@', emailaddr, 1) = 0) THEN DO
OKAY1 "No email address given"
EXIT
END
OK = 0
DO UNTIL OK = 1
ADDRESS_BOOK LIST GROUP DESCRIPTION LF
grplist = RESULT
GETLISTITEM "'"grplist"' 'Select the Group Wanted'"
grpname = RESULT
IF (grpname = "") THEN EXIT
PARSE VAR grpname grpname dflt
dflt = STRIP(dflt, 'L')
ADDRESS_BOOK GET grpname TYPE
addrtype = RESULT
IF (addrtype = -1) THEN DO
OKAY1 "Group Nickname Does Not Exist"
IF (RESULT = 1) THEN OK = 0
END
IF (addrtype = 0) THEN DO
OKAY1 "Group Nickname is already used for an Individual"
IF (RESULT = 1) THEN OK = 0
END
IF (addrtype = 1) THEN OK = 1
END
cmd = "ADDRESS_BOOK DELETE FROM GROUP " grpname "'"emailaddr"'"
cmd
IF (RESULT = -5) THEN DO
OKAY2 '"Delete Group|Leave Name in Group"' "Address was last name in group"
IF (RESULT = 1) THEN DO
cmd = "ADDRESS_BOOK DELETE GROUP " grpname
cmd
END
END
IF (RESULT = 0) THEN DO
OKAY1 emailaddr " not found in group"
END